function gewWaterNode(name)
{ 
  gewNode.call(this,name);
  this.mesh = null;  
}
extend2(gewWaterNode, gewNode);
//gewWaterNode.prototype = new gewNode();

gewWaterNode.prototype.setMesh = function(mesh)
{
  this.mesh = mesh;
  
  this.localAabb = mesh.aabb;
  this.localSphere = mesh.boundingSphere;
  
  this.localAabb = mesh.aabb;
  this.localSphere = mesh.boundingSphere;
  this.setFlag(NODE_UPDATE_TRANSLATE_MAT,true);// to force this node update world bounding volume; 
}
gewWaterNode.prototype.getMesh = function()
{
  return this.mesh;
}

gewWaterNode.prototype.render = function(material)
{
  var m = this.mesh; 
  if(m&&m.isReady)
  {  
    var gl = this.gl;
    var effect = material.effect;
    //Set up vertex att pointers
    gl.bindBuffer(gl.ARRAY_BUFFER, m.glBuffers.positions);
    gl.vertexAttribPointer(effect.inPosition, 3, gl.FLOAT, false, 0, 0);
    if (m.renderType == GEW_TRIANGLES_NON_INDICES) 
    {
      // Do the draw, as triangles
      var ver_num = m.vertices.length / 3;
      gl.drawArrays(gl.TRIANGLES, 0, ver_num);
    }
    else if(m.renderType== GEW_TRIANGLES_INDICES)
    {
      gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, m.glBuffers.indices[0]);
      gl.drawElements(gl.TRIANGLES,m.indices[0].length,gl.UNSIGNED_SHORT,0);
    }    
  }
}

